//-----------------------------------------------------------------------------
// Copyright (c) 2011 David Waby
// Initially created on 31/10/2011
//-----------------------------------------------------------------------------

#include "Global.h"
#include "Application.h"
#include "EventManager.h"
#include "World.h"

//-----------------------------------------------------------------------------
Application::Application()
:	m_world(NULL)
{
} 

//-----------------------------------------------------------------------------
Application::~Application()
{
} 

//-----------------------------------------------------------------------------
void Application::Initialise()
{
	EventManager::Create();
	m_world = new World();

	m_world->Initialise();
}

//-----------------------------------------------------------------------------
void Application::MainLoop()
{
	m_world->Input();
	m_world->Update();
	m_world->Render();
}

//-----------------------------------------------------------------------------
void Application::Shutdown()
{
	m_world->Shutdown();
	delete m_world;

	EventManager::Release();
}